import request from '@/utils/request'

// 获取所有人员信息
export function getWorkers(params) {
  return request({
    url: '/api/v1/home/workers/',
    method: 'get',
    params
  })
}

// 添加人员
export function addWorker(data) {
  return request({
    url: '/api/v1/home/workers/',
    method: 'post',
    data
  })
}

// 更新人员信息
export function updateWorker(id, data) {
  return request({
    url: `/api/v1/home/workers/${id}/`,
    method: 'put',
    data
  })
}

// 删除人员
export function deleteWorker(id) {
  return request({
    url: `/api/v1/home/workers/${id}/`,
    method: 'delete'
  })
}

// 导入Excel
export function importExcel(data) {
  return request({
    url: '/api/v1/home/workers/import/',
    method: 'post',
    data
  })
}

// 导出Excel
export function exportExcel() {
  return request({
    url: '/api/v1/home/workers/export/',
    method: 'get',
    responseType: 'blob'
  })
} 